<% reservation = @reservation%>
<h3>Create a One-Time Block</h3>
 <i> Aircraft will be unavailable: </i>
  <%=  start_form_tag :controller => 'schedule',:action => 'new_aircraft_block', :aircraft_id => params[:aircraft_id] %>
              <table>
				<tr>
			    <td style="text-align:left;"><label>From: </label></td><td>
				    <select name="s_year">
				    <%= options_for_select [Time.new.year,Time.new.year+1],reservation.time_start.year%>
				    </select>
				    <select name="s_month">
				    <%= options_for_select (1..12).map{|x| x},reservation.time_start.month%>
				    </select>
				    <select name="s_day">
				    <%= options_for_select (1..31).map{|x| x},reservation.time_start.day%>
				    </select>
				    <select name="s_hour">
				    <%= options_for_select [['12 am',0]]+(1..11).map{|x| [x.to_s+' am',x]}+[['12 pm',12]]+(1..11).map{|x| [x.to_s+' pm',x+12]},
				            reservation.time_start.hour%>
				    </select>
			    </td>
			    </tr><tr>
			    <td style="text-align:left;"><label>To: </label> </td><td>
				    <select name="e_year">
				    <%= options_for_select [Time.new.year,Time.new.year+1],reservation.time_end.year%>
				    </select>
				    <select name="e_month">
				    <%= options_for_select (1..12).map{|x| x},reservation.time_end.month%>
				    </select>
				    <select name="e_day">
				    <%= options_for_select (1..31).map{|x| x},reservation.time_end.day%>
				    </select>
				    <select name="e_hour">
				    <%= options_for_select [['12 am',0]]+(1..11).map{|x| [x.to_s+' am',x]}+[['12 pm',12]]+(1..11).map{|x| [x.to_s+' pm',x+12]},
				            reservation.time_end.hour%>
				    </select>
			    </td></tr>
			    </table>
       
        <%= submit_tag 'Create Block'%>
          <%= end_form_tag %>

<h3>Create a Pattern of Blocks</h3>
 <i> Aircraft will be unavailable on: </i>
<%=  start_form_tag :controller => 'schedule',:action => 'new_aircraft_block_pattern',:aircraft_id=>params[:aircraft_id] %>
		 		 <%=check_box_tag "days[1]",'true', false %> Mon
				 <%=check_box_tag "days[2]",'true', false %> Tue
				 <%=check_box_tag "days[3]",'true', false %> Wed
				 <%=check_box_tag "days[4]",'true', false %> Thu
				 <%=check_box_tag "days[5]",'true', false %> Fri
				 <%=check_box_tag "days[6]",'true', false %> Sat 
				 <%=check_box_tag "days[7]",'true', false %> Sun    
        <table>
	
				<tr>
			    <td style="text-align:left;"><label>From: </label></td><td>
			    <select name="from">
			    <%= options_for_select [['12 am',0]]+(1..11).map{|x| [x.to_s+' am',x]}+[['12 pm',12]]+(1..11).map{|x| [x.to_s+' pm',x+12]},
			            reservation.time_start.hour%>
			    </select>
			    </td>
			    </tr><tr>
			    <td style="text-align:left;"><label>To: </label> </td><td>
			    <select name="to">
			    <%= options_for_select [['12 am',0]]+(1..11).map{|x| [x.to_s+' am',x]}+[['12 pm',12]]+(1..11).map{|x| [x.to_s+' pm',x+12]},
			            reservation.time_end.hour%>
			    </select>
			    </td></tr>
			
					<tr>
				    <td style="text-align:left;"><label>Starting: </label></td><td>
				   		    <select name="s_year">
						    <%= options_for_select [Time.new.year,Time.new.year+1],reservation.time_start.year%>
						    </select>
						    <select name="s_month">
						    <%= options_for_select (1..12).map{|x| x},reservation.time_start.month%>
						    </select>
						    <select name="s_day">
						    <%= options_for_select (1..31).map{|x| x},reservation.time_start.day%>
						    </select>
				    </td>
				    </tr><tr>
				    <td style="text-align:left;"><label>Ending: </label> </td><td>
						    <select name="e_year">
						    <%= options_for_select [Time.new.year,Time.new.year+1],reservation.time_start.year%>
						    </select>
						    <select name="e_month">
						    <%= options_for_select (1..12).map{|x| x},reservation.time_start.month%>
						    </select>
						    <select name="e_day">
						    <%= options_for_select (1..31).map{|x| x},reservation.time_start.day%>
						    </select>
				    </td></tr>
			
			
			    </table>
     
      <%= submit_tag 'Create Block Pattern'%>
        <%= end_form_tag %>


		<h3>Clear Existing Blocks</h3>
		 <i> Clear blocks: </i>
		  <%=  start_form_tag :controller => 'schedule',:action => 'clear_aircraft_blocks', :aircraft_id=>params[:aircraft_id]%>
		              <table>
						<tr>
					    <td style="text-align:left;"><label>From: </label></td><td>
						    <select name="s_year">
						    <%= options_for_select [Time.new.year,Time.new.year+1],reservation.time_start.year%>
						    </select>
						    <select name="s_month">
						    <%= options_for_select (1..12).map{|x| x},reservation.time_start.month%>
						    </select>
						    <select name="s_day">
						    <%= options_for_select (1..31).map{|x| x},reservation.time_start.day%>
						    </select>
			  			    <select name="s_hour">
            			    <%= options_for_select [['12 am',0]]+(1..11).map{|x| [x.to_s+' am',x]}+[['12 pm',12]]+(1..11).map{|x| [x.to_s+' pm',x+12]},
            			            0%>
            			    </select>
					    </td>
					    </tr><tr>
					    <td style="text-align:left;"><label>To: </label> </td><td>
						    <select name="e_year">
						    <%= options_for_select [Time.new.year,Time.new.year+1],reservation.time_end.year%>
						    </select>
						    <select name="e_month">
						    <%= options_for_select (1..12).map{|x| x},reservation.time_end.month%>
						    </select>
						    <select name="e_day">
						    <%= options_for_select (1..31).map{|x| x},reservation.time_end.day%>
						    </select>
			  			    <select name="e_hour">
            			    <%= options_for_select [['12 am',0]]+(1..11).map{|x| [x.to_s+' am',x]}+[['12 pm',12]]+(1..11).map{|x| [x.to_s+' pm',x+12]},
            			            0%>
            			    </select>
					    </td></tr>
					    </table>

		        <%= submit_tag 'Clear Blocks'%>
		          <%= end_form_tag %>
